package com.mark.service.impl;

import com.mark.entity.school.UPatriarchStudentRelation;
import com.mark.mapper.UPatriarchStudentRelationMapper;
import com.mark.service.UPatriarchStudentRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import java.util.List;

/**
 * (UPatriarchStudentRelation)表服务实现类
 *
 * @author Deng PengFei
 * @since 2021-10-27 11:17:25
 */
@Service
public class UPatriarchStudentRelationServiceImpl implements UPatriarchStudentRelationService {
    @Autowired
    private UPatriarchStudentRelationMapper uPatriarchStudentRelationMapper;

    /**
     * 通过ID查询单条数据
     *
     * @param relId 主键
     * @return 实例对象
     */
    @Override
    public UPatriarchStudentRelation queryById(Object relId) {
        return this.uPatriarchStudentRelationMapper.queryById(relId);
    }

    /**
     * 查询多条数据
     *
     * @param offset 查询起始位置
     * @param limit 查询条数
     * @return 对象列表
     */
    @Override
    public List<UPatriarchStudentRelation> queryAllByLimit(int offset, int limit) {
        return this.uPatriarchStudentRelationMapper.queryAllByLimit(offset, limit);
    }

    /**
     * 新增数据
     *
     * @param uPatriarchStudentRelation 实例对象
     * @return 实例对象
     */
    @Override
    public UPatriarchStudentRelation insert(UPatriarchStudentRelation uPatriarchStudentRelation) {
        this.uPatriarchStudentRelationMapper.insert(uPatriarchStudentRelation);
        return uPatriarchStudentRelation;
    }

    /**
     * 修改数据
     *
     * @param uPatriarchStudentRelation 实例对象
     * @return 实例对象
     */
    @Override
    public UPatriarchStudentRelation update(UPatriarchStudentRelation uPatriarchStudentRelation) {
        this.uPatriarchStudentRelationMapper.update(uPatriarchStudentRelation);
        return this.queryById(uPatriarchStudentRelation.getRelId());
    }


}